<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<script>
    function getMax(arr) {
        var max = arr[0];
        for (var i = 1;i <= arr.length;i++){
            if (arr[i] > max){
                max = arr[i];
            }
        }
        return max;
    }
    var re = getMax([5,8,5,9,42,55]);
    console.log(re);
</script>
<body>

</body>
</html>